//
//  AppDelegate.m
//  NewsReader
//
//  Created by zhouxiaobo on 15/10/30.
//  Copyright © 2015年 mapath. All rights reserved.
//

#import "AppDelegate.h"
#import "LoginPage.h"
#import "Homepage.h"
#import "AdvertPage.h"

@interface AppDelegate ()

@end

@implementation AppDelegate

+ (AppDelegate *)appDeg {
    return  (AppDelegate *)[UIApplication sharedApplication].delegate;
}

- (void)showHomePage {
    Homepage *page = [[Homepage alloc] init];
//    UINavigationController *navController = [[UINavigationController alloc]initWithRootViewController:page];
//    
//    self.window.rootViewController = navController;
    self.window.rootViewController = page;
    [self.window makeKeyAndVisible];
}


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{
    
    [application setStatusBarStyle:UIStatusBarStyleLightContent];
    
    self.window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds];
    [AdvertPage showAdvertPage];
    
    return YES;
}

- (void)applicationWillResignActive:(UIApplication *)application {

}

- (void)applicationDidEnterBackground:(UIApplication *)application {
}

- (void)applicationWillEnterForeground:(UIApplication *)application {
    if ([AdvertPage canShowAdvertPage]) {
        [AdvertPage showAdvertPage];
    }
    
}

- (void)applicationDidBecomeActive:(UIApplication *)application {
}

- (void)applicationWillTerminate:(UIApplication *)application {
}

@end
